package io;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * 对象流
 * 高级流，作用是进行对象序列化与反序列化
 */
public class OOSDemo {
    public static void main(String[] args) throws IOException {


        String name="苍老师";
        int age=55;
        String gender="男";
        String[] otherInfo={"技术好","技术爽","拍片活好","大家的启蒙老师"};
        Person p=new Person(name,age,gender,otherInfo);
        System.out.println(p);


        FileOutputStream fos=new FileOutputStream("person.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(p);
        System.out.println("写入完毕！");
        oos.close();

    }
}
